const http = require('../utils/http')

const HTTP = new http.HTTP()

// 获取全部活动
export function getActivity(pageNum, pageSize, callback) {
    let params = {
        keywords: "",
        pageNum,
        pageSize
    }
    HTTP.request('/activity/search', 'GET', params, res => {
        callback(res)
    });
}

// 模糊搜索活动
export function searchActivity(keywords, pageNum, pageSize, callback) {
    let params = {
        keywords: keywords ?? "",
        pageNum,
        pageSize
    }
    HTTP.request('/activity/search', 'GET', params, res => {
        callback(res)
    })
}

export function jobAll(callback) {

    HTTP.request('/job/all', 'GET', {}, res => {
        callback(res)
    })
}

export function activityReleaseactivity(params, callback) {
    HTTP.request('/activity/releaseactivity1', "POST", params, res => callback(res))

}

export function activityLeave(params, callback) {
    HTTP.request("/activity/leave", "POST", params, res => {
        callback(res)
    })
}
